<template>
  <div class="sale-list">
    <Sale v-for="(item,i) in getSaleList" :key="item.id" :dataobj="item" v-show="i>=(current-1)*4 && i<current*4"
      :order="$attrs.order" v-on="$listeners" />

    <!-- <Shopcar :orderPrice="order.price" :orderNum="order.num" :orderList="order.list" /> -->
  </div>
</template>

<script>
  import Sale from '../components/Sale.vue'
  export default {
    name: 'HelloWorld',
    props: {
      current: {
        type: Number,
        default: 1
      },
      // saleList: {
      //   type: Array,
      //   default: []
      // }
    },
    data() {
      return {
        
      }
    },
    
    methods: {
      
    },
    mounted(){
      console.log(this.$listeners);
      
    },
    computed: {
      getSaleList() {
        return this.$attrs.saleList
      }
    },
    components: {
      Sale,
      // Shopcar
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .sale-list {
    box-sizing: border-box;
    padding: 0.1rem;
    flex: 2 2 auto;
    /* background-color: #f5f5f5; */
  }
</style>